<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
		<style>
			.bluetext{
				color: blue;}
		    .redtext {
			color: red;	
			}
			
		</style>>
	</head>
	<body>
		<div id="app">
			<h1>通过style 属性控制样式</h1>
			<div style="color: red;">hello word</div>
			
			<h1>通过class 属性控制样式</h1>
			<div class="bluetext">hello vu!</div>
			
			<h1>使用vue来控制元素的class属性</h1>
			<div :class="{bluetext:isActive}">hello vu!</div>{{isActive}}
		    <button @click="{isActive=!isActive}">切换</button>
		</div>
		<script >
			var app = Vue.createApp({
			
				
				data(){
					return{
						isActive: false
					}
				}
				computed: {
					textcolor() {
						console.log("textColor!")
						return: !this.isActive,
						bluetext: !this.isActive
					}
				}
			});
			var vm = app.mount("#app");
		</script>
	</body>
</html>

